#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>
#include<unordered_map>

using namespace std;

int maxFrequencyElements(vector<int>& nums) {
    unordered_map<int, int> um;
    for (auto it : nums)
        um[it]++;

    int ma = 0;
    for (auto it : um)
        ma = max(ma, it.second);

    int res = 0;
    for (auto it : um)
        if (it.second == ma) res += it.second;
    return res;
}

struct ListNode {
    int val;
    ListNode* next;
    ListNode() : val(0), next(nullptr) {}
    ListNode(int x) : val(x), next(nullptr) {}
    ListNode(int x, ListNode* next) : val(x), next(next) {}
};

ListNode* deleteDuplicates(ListNode* head) {
    ListNode* cur = head;
    while (cur != nullptr)
    {
        int num = cur->val;
        ListNode* next = cur->next;
        while (next != nullptr && next->val == num)
            next = next->next;
        cur->next = next;
        cur = next;
    }
    return head;
}